package net.xdclass.rbac_shiro.controller;

import net.xdclass.rbac_shiro.domain.JsonData;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * Created whit IntelliJ IDEA
 * User:杨骏杰
 * Date:2021/2/16
 * Time:16:42
 * 退出登陆
 * logout，映射shiro自带过滤器
 */
@RestController
public class LogoutConytroller {

    @RequestMapping("logout")
    public JsonData findMyPlayRecord(){
        Subject subject = SecurityUtils.getSubject();
        if(subject.getPrincipal() !=null){

        }
        SecurityUtils.getSubject().logout();
        return JsonData.buildSuccess("退出成功");
    }

}
